package bll

import (
	. "7qule.com/sd3/CrossServer/src/bll/kuangzhan/model"
)

type GlobalKuangzhanLayer struct {
	// 镖局一层的信息
	data map[int32]*GlobalKuangzhan
}

//
// GetPosition
// @Description: 获取节点
// @receiver this
// @param positionId 节点id
// @return result 节点信息
// @return exist 节点是否存在
//
func (this *GlobalKuangzhanLayer) GetPosition(positionId int32) (result *GlobalKuangzhan, exist bool) {
	result, exist = this.data[positionId]
	return
}

//
// AddPosition
// @Description: 添加节点
// @receiver this
// @param positionId 节点id
// @param data 节点信息
//
func (this *GlobalKuangzhanLayer) AddPosition(positionId int32, data *GlobalKuangzhan) {
	this.data[positionId] = data
}

//
// NewGlobalKuangzhanPosition
// @Description: 新建GlobalKuangzhanPosition对象
// @return *GlobalKuangzhanLayer
//
func NewGlobalKuangzhanPosition() *GlobalKuangzhanLayer {
	return &GlobalKuangzhanLayer{
		make(map[int32]*GlobalKuangzhan),
	}
}

//
// GetData
// @Description: 获取data
// @receiver this
// @return map[int32]*GlobalKuangzhan
//
func (this *GlobalKuangzhanLayer) GetData() map[int32]*GlobalKuangzhan {
	return this.data
}

//
// Delete
// @Description: 删除节点
// @receiver this
// @param positionId 节点id
//
func (this *GlobalKuangzhanLayer) Delete(positionId int32) {
	delete(this.data, positionId)
}
